{extend name="base" /}{block name="seo"}
<title>找回密码 - {$site.name}</title>
<meta name="keywords" content="{$site.keywords}">
<meta name="description" content="{$site.description}">
{/block}
{block name="css"}
<link href="__HOME__/css/user.css" rel="stylesheet" type="text/css">
{/block}
{block name="body"}
<style>
    /*兼容手机代码*/
    body{
        width:90%;
        min-width:90%;
        margin: 100px auto 0;
    }
    @media screen and (max-width: 900px) {
        .step{
            display:none;
        }
        .u-forget .forget_input{
            width:88%;
            max-width:88%;
        }
        .u-forget .title_forget{
            font-size:17px;
            margin-top:20px;
        }
        .u-forget .user_input{
            border:0;
            padding:10px 0;
            color: #5d5d5d;
            border-bottom:1px solid #F1F1F1;
            border-radius:0;
        }
        .u-forget .user_input[name="captcha"]{
            width:calc(100% - 130px);
        }
        .u-forget .forget_input .code img{
            border:0;
            border-radius:0;
            width:130px;
        }
        .u-forget .forget_next{
            border-radius:2px;
            margin-top:32px;
        }

    }
</style>
<div class="u-forget user-login">
    <h3 class="title_forget">找回登录密码</h3>
    <div class="step step{$forget.step} visible-lg visible-md"></div>
    <form class="layui-form">
    {if $forget.step eq 2}

            <input type="hidden"  name="post_type" value="step2"/>
            <input type="hidden"  name="object_type" value="{$forget.object_type}"/>
            <div class="layui-form-item">
                <span><i class="layui-icon layui-icon-username"></i></span>
                <input type="text" placeholder="请输入邮箱或手机号" name="object" value="{$forget.object}" class="layui-input">
            </div>

            <div class="layui-form-item">
                <span><i class="layui-icon layui-icon-vercode"></i></span>
                <input type="text" placeholder="请输入您收到的验证码" name="sms_code" maxlength="6" id="user" class="layui-input">
                <a href="javaScript:void(0)" style="position: absolute;line-height: 40px;background-color: #00b0fb;
    bottom: 0;
    right: 1px;
    width: 170px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: #fff;"  id="back_1">返回上一步</a>
            </div>


    {elseif $forget.step eq 3}

            <input type="hidden"  name="post_type" value="step3"/>
            <input type="hidden" value="{$forget.salt}" name="salt">
            <input type="hidden" value="{$forget.sms_code}" name="sms_code">
            <input type="hidden" value="{$forget.object}" name="object">
            <input type="hidden" value="{$forget.object_type}" name="object_type">
            <div class="layui-form-item">
               <input type="password" placeholder="输入新密码" autocomplete="off" name="password" class="layui-input"/>
            </div>
            <div class="layui-form-item">
               <input type="password" placeholder="确认新密码"  autocomplete="off" name="password_confirm" class="layui-input"/>
            </div>


    {else /}


            <input type="hidden"  name="post_type" value="step1"/>
            <div class="layui-form-item">
                <span><i class="layui-icon layui-icon-username"></i></span>
              <input type="text" placeholder="请输入邮箱或手机号" name="object" class="layui-input"/>
            </div>
            <div class="layui-form-item">
                <span><i class="layui-icon layui-icon-vercode"></i></span>
                <input type="text" id="captcha" name="captcha" placeholder="图形码" class="layui-input">
                <img src="/user/login/captcha" onclick="this.src='/user/login/captcha?'+Math.random();" style="float:left; height:38px;cursor:pointer;" id="captchaPic" title="点击我更换图片" alt="点击我更换图片">
            </div>



    {/if}
        <button class="forget_next layui-btn" lay-submit lay-filter="forget">下一步</button>
    </form>
    <div class="loo layui-clear" >
        <div class="zc">
            <a href="/user/login/register.html" class="zczh">注册账号</a>
            <a href="/user/login/index.html" target="_">登录</a>
        </div>
    </div>
</div>
{/block}
{block name="js"}
<script src="__HOME__/js/user.js"></script>
{/block}
{block name="script"}
<script>
    var countdown = "0";
    function settime(obj) {
        if (countdown == 0) {
            obj.html("返回上一步");
            $(obj).attr('href', '/user/login/forget.html');
            countdown = 60;
            return;
        } else {
            obj.html("剩余(" + countdown + ")");
            countdown--;
        }
        setTimeout(function () {
                settime(obj)
            }
            , 1000)
    }
    settime($("#back_1"));
</script>
{/block}
